import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import ErrorRoute from '@/views/errors/route'
import StartRoute from '@/views/start/route'
import MainRoute from '@/views/main/route'
import FilmRoute from '@/views/film/route'
import GoodRoute from '@/views/good/route'
const routes = [
    {
      path:"/",
      redirect:'/guide'
    },
    {
      path:"/guide",
      name:'guide',
      component:()=>import('@/views/guide/guide.vue')
    },
    {
      path:"/search",
      name:'search',
      component:()=>import('@/views/search/search.vue')
    },
    {
      path:"/city",
      name:'city',
      component:()=>import('@/views/city/city.vue')
    },
    ...ErrorRoute,
    ...StartRoute,
    ...MainRoute,
    ...FilmRoute,
    ...GoodRoute,
    {
      path:"*",
      redirect:{
        name:"notfound"
      }
    }
]

const router = new VueRouter({
  mode: 'hash',
  // base: process.env.BASE_URL,
  routes
})

export default router
